package com.honghe.mapper;

import com.honghe.entity.DocPat;
import com.honghe.entity.DoctorPatient;
import com.honghe.entity.Patient;
import com.honghe.vo.PatOrderVO;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface DocPatMapper {
    @Insert("insert into doctor_patient (doctor_id, patient_id, visit_time, name, phone, status,order_id) " +
            "values (#{doctorId}, #{patientId}, #{visitTime}, #{name}, #{phone}, #{status},#{orederId});")
    void addVisitPatient(DoctorPatient doctorPatient);
    Integer countByMap(Map<String,Object> map);
    List<DocPat> getByMap(Map<String,Object> map);
    List<PatOrderVO> getDocByPatId(Long patId);
    @Update("update doctor_patient set status = #{status} where id = #{id}")
    void updateStatus(Long id,Integer status);
    @Delete("delete from doctor_patient;")
    void deleteAll();
    void updateStatusBatch(Integer status,List<Long> ids);
    @Select("select id from doctor_patient where doctor_id = #{doctorId};")
    Long getByOrderId(Long orderId);
    @Select("select * from doctor_patient where id = #{id};")
    DoctorPatient getById(Long id);
}
